package com.example.nftapp.frg;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.example.nftapp.R;
import com.example.nftapp.adapter.MarketListAdapter;

/**
 * A simple {@link Fragment} subclass.
 * Use the {@link MarketFragment#newInstance} factory method to
 * create an instance of this fragment.
 */
public class MarketFragment extends Fragment {
    RecyclerView rv;
    @Override
    public View onCreateView(LayoutInflater inflater,ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_market, container, false);
        initId(view);
        initView(view);
        return view;
    }

    private void initView(View view){
        rv.setAdapter(new MarketListAdapter());
        rv.setLayoutManager(new LinearLayoutManager(view.getContext()));
    }

    private  void initId(View view){
        rv = view.findViewById(R.id.market_rec);
    }

}